package uk.co.q3c.deplan.client.domain.resource;

import java.io.Serializable;
import java.util.Date;

import uk.co.q3c.deplan.client.util.Calendar;

/**
 * The default working times, defined as a specific time per day, expressed in minutes
 * 
 * @author David Sowerby
 * 
 */
public class DefaultWorkingTime implements WorkingTime, Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * Returns the default working time for the day specified where day 1 = Sunday; Replace with property file or something later
	 * 
	 * @TODO
	 * @param day
	 * @return
	 */
	public int getTime(int day) {

		switch (day) {
		case Calendar.SUNDAY:
			return 0;
		case Calendar.MONDAY:
			return 450;
		case Calendar.TUESDAY:
			return 450;
		case Calendar.WEDNESDAY:
			return 450;
		case Calendar.THURSDAY:
			return 450;
		case Calendar.FRIDAY:
			return 420;
		case Calendar.SATURDAY:
			return 0;

		default:
			return 0;

		}

	}

	@SuppressWarnings("deprecation")
	@Override
	public int getWorkingTime(Date di) {
		return getTime(di.getDay());
	}

}
